package com.mutouren.modules.org.service;

import java.util.List;

import org.springframework.beans.factory.InitializingBean;

import com.mutouren.common.entity.PageInfo;
import com.mutouren.common.entity.Result;
import com.mutouren.common.entity.ResultInfo;
import com.mutouren.common.orm.spring.BaseService;
import com.mutouren.modules.org.entity.IdentityType;
import com.mutouren.modules.org.model.Function;
import com.mutouren.modules.org.model.Organization;
import com.mutouren.modules.org.model.OrganizationPerson;
import com.mutouren.modules.org.model.Person;

public interface PersonService extends BaseService<Person>, InitializingBean {

	void resetPassword(int personId);
	Result modifyPassword(int personId, String oldPassword, String newPassword);
	int updateLastLoginTime(int personId);
	int setState(OrganizationPerson op);
	void setMainPosition(int personId, int orgId);
	
	void addToOrg(int orgId, int personId);
	void removeFromOrg(int orgId, int personId);
	void changeOrg(int personId, int oldOrgId, int newOrgId);
		
	List<Person> selectByOrgId(int orgId, boolean isOnlyMainPos, boolean isCascade, String searchName, PageInfo pageInfo);
	List<Organization> selectPosition(int personId);
	List<Function> selectFunction(int personId, int appId);
	
	ResultInfo<Person> login(String userName, String password);
	Person getByIdentity(String identity, IdentityType identityType);
}
